package com.cskaoyan.service.impl;

import com.cskaoyan.mapper.MarketOrderGoodsMapper;
import com.cskaoyan.model.MarketOrderGoods;
import com.cskaoyan.model.MarketOrderGoodsExample;
import com.cskaoyan.service.OrderGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderGoodsServiceImpl implements OrderGoodsService {
    @Autowired
    MarketOrderGoodsMapper orderGoodsMapper;

    @Override
    public List<MarketOrderGoods> findByOrderId(Integer orderId) {
        MarketOrderGoodsExample example = new MarketOrderGoodsExample();
        example.createCriteria().andOrderIdEqualTo(orderId)
                .andDeletedEqualTo(false);
        List<MarketOrderGoods> marketOrderGoods = orderGoodsMapper.selectByExample(example);
        return marketOrderGoods;
    }
}
